package com.mrd.gtimp.business.service;

import com.mrd.base.BaseBiz;
import com.mrd.gtimp.business.entity.Commodity;
import com.mrd.gtimp.business.entity.Declaration;
import com.mrd.gtimp.business.repository.CommodityDao;
import com.mrd.spring.repository.BaseRepository;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

import javax.annotation.Resource;

/**
 * <p> application name: gtimp <p> copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * @author luob
 */
@Service
public class CommodityBiz extends BaseBiz<Commodity> {


    @Resource
    // 该处指定注入BaseRepository的dao对象
    @Qualifier("commodityDao")
    public void setBaseRepository(BaseRepository<Commodity, String> baseRepository) {
        super.baseRepository = baseRepository;
    }

    @Resource
    private CommodityDao commodityDao;

    public List<Commodity> findByDeclaration(Declaration declaration) {
        return commodityDao.findByDeclaration(declaration);
    }

}
